<form name="frmlist" id="frmlist" action="<?php echo $this->site['base_url']?>admin_product/search" method="post" >
<table class="title" align="center" cellspacing="0" cellpadding="0">
  <tr>
    <td class="title_label"><?php echo Kohana::lang('product_lang.tt_page')?></td>
    <td align="right">
    <button type="button" name="btn_import" class="button import" onclick="javascript:location.href='<?php echo $this->site['base_url']?>admin_product/import'">
    <span><?php echo Kohana::lang('product_lang.btn_import_product')?></span>
    </button>
    &nbsp;
    <button type="button" name="btn_new" class="button new" onclick="javascript:location.href='<?php echo $this->site['base_url']?>admin_product/create'">
    <span><?php echo Kohana::lang('product_lang.btn_new_product') ?></span>
    </button>
    </td>
  </tr>
</table>
<table class="list_top" cellspacing="0" cellpadding="0">
  <tr>
    <td><?php echo Kohana::lang('admin_lang.lbl_search')?>:
    <input type="text" id="txt_keyword" name="txt_keyword" value="<?php if(isset($keyword)) echo $keyword ?>"/>
    &nbsp;
	<button type="submit" name="btn_search" class="button search"/>
    <span><?php echo Kohana::lang('admin_lang.btn_search')?></span>
    </button>
    </td>
  </tr>
</table>
<table class="list" align="left" cellspacing="1" cellpadding="5">
  <tr class="list_header">
    <td width="10"><input type="checkbox" name="checkbox" value="checkbox" onclick='checkedAll(this.checked);' ></td>
    <?php 
    for($i=0; $i<count($list_language); $i++){ ?>
    <td><?php echo Kohana::lang('product_lang.lbl_name')?> <img src="<?php echo $this->site['base_url']?>uploads/language/<?php echo $list_language[$i]['languages_image']?>"/></td>
    <?
    }
    ?>
    <td align="center"><?php echo Kohana::lang('product_lang.lbl_qty')?></td>
    <td align="center"><?php echo Kohana::lang('product_lang.lbl_our_price')?></td>
    <td width="50" align="center"><?php echo Kohana::lang('admin_lang.lbl_order')?></td>
    <td width="50" align="center"><?php echo Kohana::lang('admin_lang.lbl_status')?></td>
    <td width="80" align="center"><?php echo Kohana::lang('admin_lang.lbl_action')?></td>
  </tr>
  <?php for($i=0; $i<count($mlist); $i++){ ?>
  <?php if(isset($mlist[$i]['languages'])){ ?>
  <tr class="row<?php if($i%2 == 0) echo 2 ?>">
    <td><input name="chk_id[]" type="checkbox" id="chk_id[]" value="<?php echo $mlist[$i]['products_id']?>"></td>
    <?php $languages = $mlist[$i]['languages']; ?>
    <?php for($j=0;$j<count($languages);$j++){ ?>
    <td style="text-align:left;">
     <a href="<?php echo $this->site['base_url']?>admin_product/edit/<?php echo $mlist[$i]['products_id']?>"><?php if(isset($languages[$j]['products_name'])) echo $languages[$j]['products_name']?></a>    
    </td>
    <?php } ?> 
    <td align="center">
        <a href="<?php echo $this->site['base_url']?>admin_product/edit/<?php echo $mlist[$i]['products_id']?>"><?php echo $mlist[$i]['products_qty']?></a>
    </td>
    <td align="center">
        <a href="<?php echo $this->site['base_url']?>admin_product/edit/<?php echo $mlist[$i]['products_id']?>"><?php echo $mlist[$i]['products_our_price']?></a>
    </td>
    <td align="center">
        <a href="<?php echo $this->site['base_url']?>admin_product/edit/<?php echo $mlist[$i]['products_id']?>"><?php echo $mlist[$i]['products_sort_order']?></a>
    </td>        
    <td align="center"> 
        <?php if($mlist[$i]['products_status']){ ?>
            <a href="<?php echo $this->site['base_url']?>admin_product/setstatus/<?php echo $mlist[$i]['products_id']?>/0" title="click to change status" >
                <img src="<?php echo $this->site['base_url']?>themes/admin/pics/icon_active.png" title="Active" />
            </a> 
        <?php }else{?>
            <a href="<?php echo $this->site['base_url']?>admin_product/setstatus/<?php echo $mlist[$i]['products_id']?>/1" title="click to change status" >
                <img src="<?php echo $this->site['base_url']?>themes/admin/pics/icon_inactive.png" title="Inactive" />
            </a>
        <?php }?>
    </td>
    <td align="center">
        <a href="<?php echo $this->site['base_url']?>admin_product/edit/<?php echo $mlist[$i]['products_id']?>">
            <img src="<?php echo $this->site['base_url']?>themes/admin/pics/icon_edit.png" title="Edit" />
        </a>
        <a href="<?php echo $this->site['base_url']?>admin_product/delete/<?php echo $mlist[$i]['products_id']?>" 
            onclick="return confirm('<?php echo Kohana::lang('errormsg_lang.msg_confirm_del')?>')" >
            <img src="<?php echo $this->site['base_url']?>themes/admin/pics/icon_delete.png" title="Delete" />
        </a>
    </td>
  </tr>
  <?php } ?>
  <?php } ?>
</table>
<br clear="all" />
<table class="list_bottom" cellspacing="0" cellpadding="5">
  <tr>
    <td>
	<select name="sel_action" id="sel_action">
		<option value="block"><?php echo Kohana::lang('admin_lang.lbl_block_selected')?></option>
		<option value="active"><?php echo Kohana::lang('admin_lang.lbl_active_selected')?></option>
		<option value="delete"><?php echo Kohana::lang('admin_lang.lbl_delete_selected')?></option>
	</select>
    &nbsp;
	<button type="button" name="btn_update" class="button save" onclick="sm_frm(frmlist,'<?php echo $this->site['base_url']?>admin_product/saveall','<?php echo Kohana::lang('errormsg_lang.msg_confirm_del')?>');"/>
    <span><?php echo Kohana::lang('admin_lang.btn_update')?></span>
    </button>
    </td>
  </tr>
</table>
<div class='pagination'><?php echo $this->pagination ?></div>
</form>